home *** CD-ROM | disk | FTP | other *** search
/ Megaware 1 / Megaware Volume 1.iso / programg / c-tutor / passref.cpp < prev    next >
Text File  |  1990-07-20  |  627b  |  36 lines

  1.                                       // Chapter 4 - Program 3
  2. #include "iostream.h"
  3. #include "stdio.h"
  4.  
  5. void fiddle(int in1, int &in2);
  6.  
  7. main()
  8. {
  9. int count = 7, index = 12;
  10.  
  11.    cout << "The values are ";
  12.    printf("%3d %3d\n", count, index);
  13.  
  14.    fiddle(count, index);
  15.  
  16.    cout << "The values are ";
  17.    printf("%3d %3d\n", count, index);
  18. }
  19.  
  20. void fiddle(int in1, int &in2)
  21. {
  22.    in1 = in1 + 100;
  23.    in2 = in2 + 100;
  24.    cout << "The values are ";
  25.    printf("%3d %3d\n", in1, in2);
  26. }
  27.  
  28.  
  29.  
  30. // Result of execution
  31. //
  32. // The values are    7  12
  33. // The values are  107 112
  34. // The values are    7 112
  35.  
  36.